import type { Token } from '@/utils/token';
import type { RouteRecordRaw } from 'vue-router';
import type { IdentityUserDto } from '@/utils/api/user/type';
import type {
  FlowNode,
  WorkflowDefinition,
  WorkflowInput,
  WorkFormComponentsRules
} from '@/utils/api/workflow/definition/type';
export interface UserState {
  // token
  token: Token | null;
  // 用户信息
  user: IdentityUserDto | null;
  // 路由
  menuRoutes: RouteRecordRaw[] | null;
  // 按钮权限
  buttons: Array<string>;
  // 模块权限
  modules: Array<string>;
}

// 用户设置
export interface UserSetting {
  fold: boolean;
  refsh: boolean;
}

// 工作流仓库对象
export interface WorkFormState {
  totalCount: number;
  currentPage: number;
  pageSize: number;
  list: Array<WorkflowDefinition>;
  auditList: any[];
  loading: boolean;
  editWorkflow?: WorkflowDefinition;
  //工作流表单数据结构
  formComponents: WorkflowInput[];
  // 规则
  rules: WorkFormComponentsRules[];
  // 节点
  nodes: Array<FlowNode>;
  stepBodys: any[];
  endpointOptions: any;
  // jsplumb 配置
  // https://github.com/jsplumb/community-edition
  jsPlumbOptions: any;
}
